<div th:fragment="ajax-table (id,head,ajaxurl)">
<table th:id="${id}" class="table table-bordered table-hover dataTable">
    <!--<thead>-->
    <!--<tr role="row">-->
        <!--<th th:each="name : ${head}" th:text="${name}"></th>-->
        <!--<th>操作</th>-->
    <!--</tr>-->
    <!--</thead>-->
    <tbody>
    </tbody>
    <tfoot>

    </tfoot>
</table>
<script th:inline="javascript">
    $.App.Page[ [[${id}]] ] = $('#' + [[ ${id} ]]).DataTable({
        "processing": true,
        "serverSide": true,
        "ajax": {
            "url": [[${ajaxurl}]],
            "contentType": "application/json",
            "type": "POST",
            "data": function ( d ) {
                return JSON.stringify( d );
            }
        },
        "columns": $.App.Page[ [[${id}]] ]['columns'],
        "columnDefs": $.App.Page[ [[${id}]] ]['columnDefs'],
        "order": [[1, 'asc']],
        "drawCallback": $.App.Page[ [[${id}]] ]['drawCallback']
    });
</script>
</div>
